#include "stm32h7xx_hal.h"

#define DWT_INIT     \
    DWT->CYCCNT = 0; \
    DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;

#define DWT_CNT DWT->CYCCNT

/* timer will stop when debugging */
#define DISABLE_TIME_DEBUG          \
    *(uint32_t *)0x5c00103c = 0x07; \
    *(uint32_t *)0x5c00104c = 0x01

